@import 'variables.less';
@import 'includes/details.less';

.loading-data {
  margin: 20px;
  padding: 10px;
  position: relative;
  text-align: center;
  z-index: 1;

  &:before {
    background: #ffc;
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
  }
}

.dashboards {
  #dashboard-readouts {
    display: none;
  }

  table {
    border-collapse: collapse;
    clear: both;
    text-align: left;
    width: 100%;

    &.overview {
      small {
        font-size: 80%;
        color: #999;
        display: block;
        white-space: nowrap;
      }

      td {
        &:nth-child(2) {
          text-align: right;
        }

        &:nth-child(4) {
          font-size: 13px;
          width: 50%;
        }
      }
    }

    &.l10n-overview {
      tr {
        &.most-visited-row {
          border-bottom: none;
          font-size: 130%;

          + tr {
            .percent-graph {
              height: 30px;
              position: relative;

              > span {
                font-weight: bold;
                left: 50%;
                margin-left: -50px;
                position: absolute;
                text-align: center;
                top: 5px;
                width: 100px;
              }
            }
          }
        }
      }

      td {
        &:nth-child(1) {
          width: 30%;
        }

        &:nth-child(2) {
          width: 20%;
        }

        &:nth-child(3) {
          width: 50%;
        }

        &.row-title {
          position: relative;

          > div {
            background: #fff;
            border: 1px solid #ccc;
            display: none;
            font-size: 14px;
            padding: 10px;
            position: absolute;
            width: 300px;
            z-index: 10;
          }

          &:hover {
            > div {
              display: block;
            }
          }
        }
      }

      .percent-graph {
        width: 100%;
      }
    }

    &.documents {
      .users {
        font-size: 90%;
        color: #999;
      }

      td {
        &:nth-child(1) {
          width: 230px;
        }

        &:nth-child(2) {
          padding-right: 6px;
          text-align: right;
          width: 75px;
        }

        &:nth-child(3) {
          padding-left: 0;
          width: 125px;
        }

        &:nth-child(4) {
          font-size: 13px;
          text-align: right;
          vertical-align: middle;
          width: 225px;
        }
      }

      th {
        &:nth-child(3) {
          padding-left: 0;
          width: 125px;
        }

        &:nth-child(4) {
          text-align: right;
          vertical-align: middle;
          width: 225px;
        }
      }
    }

    &.busy {
      opacity: 0.5;
    }
  }

  tr {
    border-bottom: solid 1px @borderLightGrey;
  }

  td {
    padding: 7px 12px;
    vertical-align: middle;

    &.status {
      .review,
      .ok,
      .update,
      .out-of-date,
      .untranslated {
        display: inline-block;  /* so width applies */
        line-height: 0;
        text-align: center;
        width: 15pt;
      }

      .update:after {
        content: '\25C6'; /* Diamond */
        color: #f8e687;
        font-size: 130%; /* Compromise between looking huge on Windows and tiny on the Mac. Using an explicit font-family avails not. */
      }

      .out-of-date:after {
        content: '\25C6'; /* Diamond */
        color: orange;
        font-size: 130%;
      }

      .untranslated:after {
        content: '\25B2'; /* Triangle */
        color: #f00;
        font-size: 120%;
      }

      .ok:after {
        content: '\25CF'; /* Circle */
        color: #add575;
        font-size: 200%;
      }

      .review:after {
        content: '\25A0'; /* Square */
        color: #7580d5;
        font-size: 200%;
      }
    }
  }

  th {
    font-size: 90%;
    font-weight: bold;
    padding: 7px 12px 2px;
    vertical-align: bottom;
  }

  div.percent-graph {
    background: #f3f3f3;
    height: 10px;
    width: 70px;

    div {
      background: #dfdfdf;
      height: 100%;

      &.bad {
        background: #ff6b6b;
      }

      &.better {
        background: #e8c679;
      }

      &.best {
        background: #c1e58f;
      }
    }
  }

  div.absolute-graph {
    background: #fff;
    height: 12px;
  }

  #overview-options {
    margin: 0;
    padding: 7px 12px;

    label {
      font-weight: bold;
    }
  }

  .table-footer {
    font-size: 90%;
    margin: 0;
    padding: 7px 12px;
  }

  ul.readout-modes {
    display: inline-block;
    float: right;

    li {
      cursor: pointer;
      display: inline-block;
      list-style: none;
      margin: 0 1px;
      padding: 3px 10px;
      vertical-align: -6px;

      &.active {
        a {
          color: @textDarkGrey;
          font-weight: bold;
        }
      }
    }
  }

  details {
    summary {
      margin: 10px 0 0;

      &.with-mode-selectors {
        display: inline;
      }
    }

    table {
      display: block;  /* Makes collapse animation work */
      margin-top: 4px;
    }

    p {
      clear: both;
      color: #666;
      font-size: 13px;
      padding: 9px 12px 0;
      text-align: justify;
    }
  }

  #show-chart {
    display: inline-block;
    margin: 15px 0;
  }
}

.html-rtl {
  .dashboards {
    table {
      text-align: right;

      &.overview {
        td {
          &:nth-child(2) {
            text-align: left;
          }
        }
      }

      &.documents {
        td {
          &:nth-child(2) {
            padding-left: 6px;
            padding-right: 12px;
            text-align: left;
          }

          &:nth-child(3) {
            padding-left: 12px;
            padding-right: 0;
          }

          &:nth-child(4) {
            text-align: left;
          }
        }

        th {
          &:nth-child(3) {
            padding-left: 12px;
            padding-right: 0;
          }

          &:nth-child(4) {
            text-align: left;
          }
        }
      }
    }

    ul.readout-modes {
      float: left;
    }

    details {
      p {
        color: #666;
        padding: 9px 0 0 12px;
      }
    }
  }
}

.dashboards-detail {
  h1 {
    display: inline-block;
  }

  tr.header-row {
    counter-reset: doctitles;
  }

  td.doc-title:before{
    counter-increment: doctitles;
    content: counter(doctitles) ". ";
  }
}

#kb-overview-table {
  td {
    &.status,
    &.ready-for-l10n.yes {
      background: rgba(0, 255, 0, 0.1);

      &.needs-review {
        background: rgba(255, 0, 0, 0.1);
      }
    }

    &.needs-update,
    &.stale {
      &.yes {
        background: rgba(255, 153, 0, 0.1);
      }
    }
  }
}

/* Some tweaks for Need Changes table */
#need-changes-table {
  td {
    padding-top: 14px;
    vertical-align: top;
  }

  tr {
    cursor: pointer;

    &.active {
      div.custom {
        max-height: none;
      }
    }
  }

  th:nth-child(4),
  td:nth-child(4) {
    padding-top: 7px;
    text-align: left;
  }

  div.custom {
    max-height: 50px;
    overflow: hidden;
  }
}

.category-filter {
  float: right;
  margin-top: 10px;
}

/* Email notifications */
#doc-watch {
  display: inline;

  .popup-trigger {
    font-weight: bold;
    padding-left: 10px;

    img {
      background: transparent @iconsSprite no-repeat -50px -1213px;
      height: 9px;
      width: 16px;
    }
  }

  .popup-menu {
    display: none;
    position: relative;
    width: 250px;

    table {
      background: #fff;
      border: none;
      border-collapse: separate;
      border-radius: 7px;
      box-shadow: 1px 2px 15px #AAAAAA;
      font-size: 13px;
      left: 0;
      padding: 10px;
      position: absolute;
      top: 5px;
      z-index: 10;

      &:before {
        background: #fff;
        content: '';
        display: block;
        height: 15px;
        left: 58px;
        margin-bottom: -13px;
        position: relative;
        top: -18px;
        transform: rotate(45deg);
        width: 15px;
        z-index: 1;
      }
    }
  }

  th {
    font-weight: normal;

    &.state {
      &:first-child {
        text-align: right;
      }

      &:last-child {
        text-align: left;
      }
    }
  }

  th,
  td {
    padding: 0.1em 0.4em;
    text-align: center;
    vertical-align: baseline;
  }

  p.note {
    font-size: 12px;
    padding: 10px;
  }
}

.html-rtl {
  #doc-watch {
    .popup-trigger {
      padding: 2px 20px 2px 0;
    }

    .popup-menu {
      table {
        left: auto;
        right: -67px;
      }
    }

    table {
      &:before {
        left: auto;
        right: 58px;
      }
    }

    th.state {
      &:first-child {
        text-align: left;
      }

      &:last-child {
        text-align: right;
      }
    }
  }
}

#kb-helpfulness-chart {
  min-height: 400px;

  section {
    background: url('../img/wait-trans.gif') no-repeat center center;
    height: 400px;
    margin: 20px 0;
    width: 680px;
  }

  .graph {
    padding: 10px;
    position: relative;
  }

  .grouping {
    position: absolute;
    right: 20px;
    top: 50px;
    z-index: 2;
  }

  .placeholder {
    z-index: 1;
  }
}

.announcements {
  background: url('../img/warning-stripes.png') top left repeat-x #ffe;
  border: 1px solid #fffbe7;
  margin: 20px 0;
  padding: 10px 15px;

  li {
    list-style: none;

    &:not(:first-child) {
      border-top: 1px solid rgb(193, 197, 200);
    }
  }
}

#create-announcement {
  .btn {
    img {
      background: transparent @iconsSprite no-repeat -50px -978px;
      height: 14px;
      width: 14px;
      display: inline-block;
      position: relative;
      left: -2px;
      top: 2px;
    }
  }

  .success {
    display: none;
    padding: 3px;
    border-radius: 5px;
    background: #c1e58f;
  }

  .kbox-container {
    position: relative;
    top: 4px;

    &:before {
      background: #fff;
      content: '';
      display: block;
      height: 15px;
      left: 58px;
      margin-bottom: -13px;
      position: relative;
      top: -8px;
      box-shadow: -1px -1px 1px rgba(0, 0, 0, 0.2);
      transform: rotate(45deg);
      width: 15px;
      z-index: 1;
    }

    form {
      ul {
        padding: 0;
        li {
          list-style: none;
          margin-bottom: 10px;

          label {
            width: 100px;
            text-align: right;
            display: inline-block;
            margin-right: 5px;
          }

          textarea {
            width: 335px;
          }
        }
      }

      .btn-submit {
        margin-left: 105px;
      }

      .error {
        color: #f00;
        margin-bottom: 25px;
      }

      .spinner {
        opacity: 0;
        vertical-align: bottom;
        transition: opacity 0.1s;
      }
      &.wait .spinner {
        opacity: 1;
      }
    }
  }
}

#product-selector {
  float: right;
  font-size: 18px;
}

.rickshaw {
  background: #fff;
  border-radius: 5px;
  padding: 20px 10px;
}

.aggregated-metrics {
  #locale-picker {
    ul {
      list-style: none;
      padding: 0;
    }
  }
}

.localization-dashboard {
  #stats-tabs {
    margin-top: 32px;

    > ul {
      list-style: none;
      margin: 0;
      padding: 0 20px;

      > li {
        border-radius: 6px 6px 0 0;
        color: @textBlue;
        cursor: pointer;
        float: left;
        margin-right: 2px;
        padding: 12px 20px;

        &:hover {
          color: @textDarkBlue;
        }

        &.selected {
          background: #fff;
          color: #000;
          font-weight: bold;
        }
      }
    }

    > div {
      padding: 20px;
      position: relative;

      &:before {
        background: transparent;
        background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
        content: '';
        height: 60px;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 0;
      }

      > div {
        position: relative;
        z-index: 1;
      }
    }
  }
}
